﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<InternshipManagement.Models.Semester>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
    CreateEdit
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

<script src="<%: Url.Content("~/Scripts/jquery.validate.min.js") %>" type="text/javascript"></script>
<script src="<%: Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js") %>" type="text/javascript"></script>
    <% 
        
        ViewBag.SemesterOp = ViewBag.Op == "Create" ? 2 : 3;
        Html.RenderPartial("SemesterMenu"); 
    %>
<% using (Html.BeginForm()) { %>
    <%: Html.ValidationSummary(true) %>
    <fieldset class="twocolumns">
        <div class="editor-label">
            <%: Html.ValidationMessageFor(model => model.Season)%>
        </div>
        <div class="editor-field">
            <%: Html.LabelFor(model => model.Season)%>
            <%: Html.DropDownListFor(model => model.Season, 
                                    new SelectList(
                                        new List<Object>{ 
                                            new { value = "FALL" , text = "FALL"  },
                                            new { value = "WINTER" , text = "WINTER" },
                                            new { value = "SPRING" , text = "SPRING"},
                                            new { value = "SUMMER" , text = "SUMMER"}
                                        },
                                "value",
                                "text",
                   Model==null ? "FALL" : Model.Season
           ))%>
        </div>

        <div class="editor-label">
            <%: Html.ValidationMessageFor(model => model.Year)%>
        </div>
        <div class="editor-field">
            <%: Html.LabelFor(model => model.Year)%>
            <%: Html.EditorFor(model => model.Year)%>
        </div>

        <p>
            <input type="submit" value="Save" />
        </p>
    </fieldset>
<% } %>

</asp:Content>

